﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

namespace 装箱和拆箱
{
    class Program
    {
        static void Main(string[] args)
        {
            //    int a = 0;
            //    object b = a;//装箱
            //     a = (int)b;//拆箱
            //装箱会
            //ArrayList list = new ArrayList();
            //List<int> list = new List<int>();
            //这个循环里面发生了一百万次装箱
            //00:00:00.0481666
            //00:00:00.0059839
            //Stopwatch sw = new Stopwatch();
            //sw.Start();
            //for (int i = 0; i < 1000000; i++)
            //{
            //    list.Add(i);//装箱

            //}
            //sw.Stop();
            //Console.WriteLine(sw.Elapsed);

            //这个地方没有发生装箱和拆箱
            string str = "123";
            int n = Convert.ToInt32(str);
            Console.ReadKey();
        }
    }
}
